
		var user = document.getElementById('user');
		var pwd  = document.getElementById('pwd');
		var pwd2  = document.getElementById('pwd2');
		var tel  = document.getElementById('tel');
		var email  = document.getElementById('email');
		var p1  = document.getElementById('SpUser');
		var p2  =document.getElementById('SpPwd');
		var p3  =document.getElementById('Sptel');
		var p4  =document.getElementById('Spemail');	
		var a;
		var b;
		function getuser(){
			var code =/^[a-zA-Z]\w{4,16}[0-9]$/;
			var  str = user.value;
			if(code.test(str)){
				p1.innerHTML ="用户名格式正确";
				p1.style.color ='#66ffff';
				a=1;

			}else{
				p1.innerHTML = '用户名格式错误';
				p1 .style.color = '#ff0066';
			}

		}
		user.onblur = getuser();
		user.onfocus = function(){
			p1.innerHTML="";
		}
		function isPwd(){
			var code =/^[a-zA-Z0-9_-]{4,16}$/;
			var str  = pwd.value;
			if(code.test(str)){
				p2.innerHTML ="密码格式正确";
				p2.style.color ='#66ffff';
				b=1;
			}else{
				p2.innerHTML = '密码格式错误';
				p2 .style.color = '#ff0066';
			}
		}
			pwd.onblur = isPwd;
		pwd.onfocus = function(){
			p2.innerHTML="";
		}
		function isTel(){
			var code =/13[123569]{1}\d{8}|15[1235689]\d{8}|188\d{8}/;
			var str  = tel.value;
			if(code.test(str)){
				p3.innerHTML ="手机格式正确";
				p3.style.color ='#66ffff';
			}else{
				p3.innerHTML = '手机格式错误';
				p3 .style.color = '#ff0066';
			}

		}
			tel.onblur = isTel;
		tel.onfocus = function(){
			p3.innerHTML="";
		}
		function isEmail(){
			var code =/^\w+\@\w+\.(cn|org|com)$/;
			var str  = email.value;
			if(code.test(str)){
				p4.innerHTML ="邮箱格式正确";
				p4.style.color ='#66ffff';
			}else{
				p4.innerHTML = '邮箱格式错误';
				p4.style.color = '#ff0066';
			}
		}
			email.onblur = isEmail;
		email.onfocus = function(){
			p4.innerHTML="";
		}
		function  check(){
			if(a==1 && b==1){
				return true;
			}else{
				return false;
			}
		}
